<span page-title ng-model="hostCollection">{{ 'Add Content Hosts to: ' | translate }} {{ hostCollection.name }}</span>

<div data-extend-template="layouts/partials/table.html">

  <div data-block="list-actions">
    <div ng-hide="hostCollection.readonly" class="nutupane-actions fr">
       <button type="button" class="btn btn-default"
               ng-hide="denied('edit_hosts')"
               ng-disabled="disableAddButton()"
               ng-click="addSelected()">
         <span translate>Add Selected</span>
       </button>
    </div>
  </div>

  <span data-block="no-rows-message" translate>
    You currently don't have any Content Hosts, you can create new Content Hosts by selecting Contents Host from main menu and then clicking the button on the right.
  </span>

  <span data-block="no-search-results-message" translate>
    Your search returned zero Content Hosts.
  </span>

  <div data-block="table">
    <table ng-class="{'table-mask': table.working}" class="table table-bordered table-striped">
      <thead>
        <tr bst-table-head row-select>
          <th bst-table-column="name" translate>Name</th>
          <th bst-table-column="environment" translate>Environment</th>
          <th bst-table-column="content_view" translate>Content View</th>
        </tr>
      </thead>

      <tbody>
      <tr bst-table-row ng-repeat="host in table.rows">
        <td class="row-select">
          <input type="checkbox"
                 ng-model="host.selected"
                 ng-change="itemSelected(host)"/>
        </td>
        <td bst-table-cell >
          <a ui-sref="content-host.info({hostId: host.id})">
            {{ host.name}}
          </a>
        </td>
        <td bst-table-cell >{{ host.content_facet_attributes.lifecycle_environment.name}}</td>
        <td bst-table-cell >{{ host.content_facet_attributes.content_view.name}}</td>
      </tr>

      </tbody>
    </table>
  </div>
</div>
